home *** CD-ROM | disk | FTP | other *** search
/ Freelog 121 / FreelogMagazineJuilletAout2014-No121.iso / Outils / Adobe-Air / adobe-air_13.exe / [0] / setup.swf / scripts / mx / containers / utilityClasses / CanvasLayout.as < prev    next >
Text File  |  2014-03-27  |  54KB  |  1,648 lines

  1. package mx.containers.utilityClasses
  2. {
  3.    import flash.display.DisplayObject;
  4.    import flash.geom.Rectangle;
  5.    import flash.utils.Dictionary;
  6.    import mx.containers.errors.ConstraintError;
  7.    import mx.core.Container;
  8.    import mx.core.EdgeMetrics;
  9.    import mx.core.FlexVersion;
  10.    import mx.core.IConstraintClient;
  11.    import mx.core.IUIComponent;
  12.    import mx.core.mx_internal;
  13.    import mx.events.ChildExistenceChangedEvent;
  14.    import mx.events.MoveEvent;
  15.    
  16.    use namespace mx_internal;
  17.    
  18.    public class CanvasLayout extends Layout
  19.    {
  20.       
  21.       mx_internal static const VERSION:String = "3.0.0.0";
  22.       
  23.       private static var r:Rectangle = new Rectangle();
  24.        
  25.       
  26.       private var colSpanChildren:Array;
  27.       
  28.       private var constraintRegionsInUse:Boolean = false;
  29.       
  30.       private var rowSpanChildren:Array;
  31.       
  32.       private var constraintCache:Dictionary;
  33.       
  34.       private var _contentArea:Rectangle;
  35.       
  36.       public function CanvasLayout()
  37.       {
  38.          colSpanChildren = [];
  39.          rowSpanChildren = [];
  40.          constraintCache = new Dictionary(true);
  41.          super();
  42.       }
  43.       
  44.       private function parseConstraints(param1:IUIComponent = null) : ChildConstraintInfo
  45.       {
  46.          var _loc3_:Number = NaN;
  47.          var _loc4_:Number = NaN;
  48.          var _loc5_:Number = NaN;
  49.          var _loc6_:Number = NaN;
  50.          var _loc7_:Number = NaN;
  51.          var _loc8_:Number = NaN;
  52.          var _loc9_:Number = NaN;
  53.          var _loc10_:String = null;
  54.          var _loc11_:String = null;
  55.          var _loc12_:String = null;
  56.          var _loc13_:String = null;
  57.          var _loc14_:String = null;
  58.          var _loc15_:String = null;
  59.          var _loc16_:String = null;
  60.          var _loc17_:Array = null;
  61.          var _loc18_:int = 0;
  62.          var _loc30_:ConstraintColumn = null;
  63.          var _loc31_:Boolean = false;
  64.          var _loc32_:ConstraintRow = null;
  65.          var _loc2_:LayoutConstraints = getLayoutConstraints(param1);
  66.          if(!_loc2_)
  67.          {
  68.             return null;
  69.          }
  70.          if(!(_loc17_ = parseConstraintExp(_loc2_.left)))
  71.          {
  72.             _loc3_ = NaN;
  73.          }
  74.          else if(_loc17_.length == 1)
  75.          {
  76.             _loc3_ = Number(_loc17_[0]);
  77.          }
  78.          else
  79.          {
  80.             _loc10_ = _loc17_[0];
  81.             _loc3_ = _loc17_[1];
  82.          }
  83.          if(!(_loc17_ = parseConstraintExp(_loc2_.right)))
  84.          {
  85.             _loc4_ = NaN;
  86.          }
  87.          else if(_loc17_.length == 1)
  88.          {
  89.             _loc4_ = Number(_loc17_[0]);
  90.          }
  91.          else
  92.          {
  93.             _loc11_ = _loc17_[0];
  94.             _loc4_ = _loc17_[1];
  95.          }
  96.          if(!(_loc17_ = parseConstraintExp(_loc2_.horizontalCenter)))
  97.          {
  98.             _loc5_ = NaN;
  99.          }
  100.          else if(_loc17_.length == 1)
  101.          {
  102.             _loc5_ = Number(_loc17_[0]);
  103.          }
  104.          else
  105.          {
  106.             _loc12_ = _loc17_[0];
  107.             _loc5_ = _loc17_[1];
  108.          }
  109.          if(!(_loc17_ = parseConstraintExp(_loc2_.top)))
  110.          {
  111.             _loc6_ = NaN;
  112.          }
  113.          else if(_loc17_.length == 1)
  114.          {
  115.             _loc6_ = Number(_loc17_[0]);
  116.          }
  117.          else
  118.          {
  119.             _loc13_ = _loc17_[0];
  120.             _loc6_ = _loc17_[1];
  121.          }
  122.          if(!(_loc17_ = parseConstraintExp(_loc2_.bottom)))
  123.          {
  124.             _loc7_ = NaN;
  125.          }
  126.          else if(_loc17_.length == 1)
  127.          {
  128.             _loc7_ = Number(_loc17_[0]);
  129.          }
  130.          else
  131.          {
  132.             _loc14_ = _loc17_[0];
  133.             _loc7_ = _loc17_[1];
  134.          }
  135.          if(!(_loc17_ = parseConstraintExp(_loc2_.verticalCenter)))
  136.          {
  137.             _loc8_ = NaN;
  138.          }
  139.          else if(_loc17_.length == 1)
  140.          {
  141.             _loc8_ = Number(_loc17_[0]);
  142.          }
  143.          else
  144.          {
  145.             _loc15_ = _loc17_[0];
  146.             _loc8_ = _loc17_[1];
  147.          }
  148.          if(!(_loc17_ = parseConstraintExp(_loc2_.baseline)))
  149.          {
  150.             _loc9_ = NaN;
  151.          }
  152.          else if(_loc17_.length == 1)
  153.          {
  154.             _loc9_ = Number(_loc17_[0]);
  155.          }
  156.          else
  157.          {
  158.             _loc16_ = _loc17_[0];
  159.             _loc9_ = _loc17_[1];
  160.          }
  161.          var _loc19_:ContentColumnChild = new ContentColumnChild();
  162.          var _loc20_:Boolean = false;
  163.          var _loc21_:Number = 0;
  164.          var _loc22_:Number = 0;
  165.          var _loc23_:Number = 0;
  166.          _loc18_ = 0;
  167.          while(_loc18_ < IConstraintLayout(target).constraintColumns.length)
  168.          {
  169.             if((_loc30_ = IConstraintLayout(target).constraintColumns[_loc18_]).mx_internal::contentSize)
  170.             {
  171.                if(_loc30_.id == _loc10_)
  172.                {
  173.                   _loc19_.leftCol = _loc30_;
  174.                   _loc19_.leftOffset = _loc3_;
  175.                   _loc19_.left = _loc21_ = _loc18_;
  176.                   _loc20_ = true;
  177.                }
  178.                if(_loc30_.id == _loc11_)
  179.                {
  180.                   _loc19_.rightCol = _loc30_;
  181.                   _loc19_.rightOffset = _loc4_;
  182.                   _loc19_.right = _loc22_ = _loc18_ + 1;
  183.                   _loc20_ = true;
  184.                }
  185.                if(_loc30_.id == _loc12_)
  186.                {
  187.                   _loc19_.hcCol = _loc30_;
  188.                   _loc19_.hcOffset = _loc5_;
  189.                   _loc19_.hc = _loc23_ = _loc18_ + 1;
  190.                   _loc20_ = true;
  191.                }
  192.             }
  193.             _loc18_++;
  194.          }
  195.          if(_loc20_)
  196.          {
  197.             _loc19_.child = param1;
  198.             if(_loc19_.leftCol && !_loc19_.rightCol || _loc19_.rightCol && !_loc19_.leftCol || _loc19_.hcCol)
  199.             {
  200.                _loc19_.span = 1;
  201.             }
  202.             else
  203.             {
  204.                _loc19_.span = _loc22_ - _loc21_;
  205.             }
  206.             _loc31_ = false;
  207.             _loc18_ = 0;
  208.             while(_loc18_ < colSpanChildren.length)
  209.             {
  210.                if(_loc19_.child == colSpanChildren[_loc18_].child)
  211.                {
  212.                   _loc31_ = true;
  213.                   break;
  214.                }
  215.                _loc18_++;
  216.             }
  217.             if(!_loc31_)
  218.             {
  219.                colSpanChildren.push(_loc19_);
  220.             }
  221.          }
  222.          _loc20_ = false;
  223.          var _loc24_:ContentRowChild = new ContentRowChild();
  224.          var _loc25_:Number = 0;
  225.          var _loc26_:Number = 0;
  226.          var _loc27_:Number = 0;
  227.          var _loc28_:Number = 0;
  228.          _loc18_ = 0;
  229.          while(_loc18_ < IConstraintLayout(target).constraintRows.length)
  230.          {
  231.             if((_loc32_ = IConstraintLayout(target).constraintRows[_loc18_]).mx_internal::contentSize)
  232.             {
  233.                if(_loc32_.id == _loc13_)
  234.                {
  235.                   _loc24_.topRow = _loc32_;
  236.                   _loc24_.topOffset = _loc6_;
  237.                   _loc24_.top = _loc25_ = _loc18_;
  238.                   _loc20_ = true;
  239.                }
  240.                if(_loc32_.id == _loc14_)
  241.                {
  242.                   _loc24_.bottomRow = _loc32_;
  243.                   _loc24_.bottomOffset = _loc7_;
  244.                   _loc24_.bottom = _loc26_ = _loc18_ + 1;
  245.                   _loc20_ = true;
  246.                }
  247.                if(_loc32_.id == _loc15_)
  248.                {
  249.                   _loc24_.vcRow = _loc32_;
  250.                   _loc24_.vcOffset = _loc8_;
  251.                   _loc24_.vc = _loc27_ = _loc18_ + 1;
  252.                   _loc20_ = true;
  253.                }
  254.                if(_loc32_.id == _loc16_)
  255.                {
  256.                   _loc24_.baselineRow = _loc32_;
  257.                   _loc24_.baselineOffset = _loc9_;
  258.                   _loc24_.baseline = _loc28_ = _loc18_ + 1;
  259.                   _loc20_ = true;
  260.                }
  261.             }
  262.             _loc18_++;
  263.          }
  264.          if(_loc20_)
  265.          {
  266.             _loc24_.child = param1;
  267.             if(_loc24_.topRow && !_loc24_.bottomRow || _loc24_.bottomRow && !_loc24_.topRow || _loc24_.vcRow || _loc24_.baselineRow)
  268.             {
  269.                _loc24_.span = 1;
  270.             }
  271.             else
  272.             {
  273.                _loc24_.span = _loc26_ - _loc25_;
  274.             }
  275.             _loc31_ = false;
  276.             _loc18_ = 0;
  277.             while(_loc18_ < rowSpanChildren.length)
  278.             {
  279.                if(_loc24_.child == rowSpanChildren[_loc18_].child)
  280.                {
  281.                   _loc31_ = true;
  282.                   break;
  283.                }
  284.                _loc18_++;
  285.             }
  286.             if(!_loc31_)
  287.             {
  288.                rowSpanChildren.push(_loc24_);
  289.             }
  290.          }
  291.          var _loc29_:ChildConstraintInfo = new ChildConstraintInfo(_loc3_,_loc4_,_loc5_,_loc6_,_loc7_,_loc8_,_loc9_,_loc10_,_loc11_,_loc12_,_loc13_,_loc14_,_loc15_,_loc16_);
  292.          constraintCache[param1] = _loc29_;
  293.          return _loc29_;
  294.       }
  295.       
  296.       private function bound(param1:Number, param2:Number, param3:Number) : Number
  297.       {
  298.          if(param1 < param2)
  299.          {
  300.             param1 = param2;
  301.          }
  302.          else if(param1 > param3)
  303.          {
  304.             param1 = param3;
  305.          }
  306.          else
  307.          {
  308.             param1 = Math.floor(param1);
  309.          }
  310.          return param1;
  311.       }
  312.       
  313.       private function shareRowSpace(param1:ContentRowChild, param2:Number) : Number
  314.       {
  315.          var _loc11_:Number = NaN;
  316.          var _loc12_:Number = NaN;
  317.          var _loc13_:Number = NaN;
  318.          var _loc3_:ConstraintRow = param1.topRow;
  319.          var _loc4_:ConstraintRow = param1.bottomRow;
  320.          var _loc5_:IUIComponent = param1.child;
  321.          var _loc6_:Number = 0;
  322.          var _loc7_:Number = 0;
  323.          var _loc8_:Number = !!param1.topOffset ? Number(param1.topOffset) : Number(0);
  324.          var _loc9_:Number = !!param1.bottomOffset ? Number(param1.bottomOffset) : Number(0);
  325.          if(_loc3_ && _loc3_.height)
  326.          {
  327.             _loc6_ += _loc3_.height;
  328.          }
  329.          else if(_loc4_ && !_loc3_)
  330.          {
  331.             _loc3_ = IConstraintLayout(target).constraintRows[param1.bottom - 2];
  332.             if(_loc3_ && _loc3_.height)
  333.             {
  334.                _loc6_ += _loc3_.height;
  335.             }
  336.          }
  337.          if(_loc4_ && _loc4_.height)
  338.          {
  339.             _loc7_ += _loc4_.height;
  340.          }
  341.          else if(_loc3_ && !_loc4_)
  342.          {
  343.             if((_loc4_ = IConstraintLayout(target).constraintRows[param1.top + 1]) && _loc4_.height)
  344.             {
  345.                _loc7_ += _loc4_.height;
  346.             }
  347.          }
  348.          if(_loc3_ && isNaN(_loc3_.height))
  349.          {
  350.             _loc3_.setActualHeight(Math.max(0,_loc3_.maxHeight));
  351.          }
  352.          if(_loc4_ && isNaN(_loc4_.height))
  353.          {
  354.             _loc4_.setActualHeight(Math.max(0,_loc4_.height));
  355.          }
  356.          var _loc10_:Number;
  357.          if(_loc10_ = _loc5_.getExplicitOrMeasuredHeight())
  358.          {
  359.             if(!param1.topRow)
  360.             {
  361.                if(_loc10_ > _loc6_)
  362.                {
  363.                   _loc12_ = _loc10_ - _loc6_ + _loc9_;
  364.                }
  365.                else
  366.                {
  367.                   _loc12_ = _loc10_ + _loc9_;
  368.                }
  369.             }
  370.             if(!param1.bottomRow)
  371.             {
  372.                if(_loc10_ > _loc7_)
  373.                {
  374.                   _loc11_ = _loc10_ - _loc7_ + _loc8_;
  375.                }
  376.                else
  377.                {
  378.                   _loc11_ = _loc10_ + _loc8_;
  379.                }
  380.             }
  381.             if(param1.topRow && param1.bottomRow)
  382.             {
  383.                if((_loc13_ = _loc10_ / Number(param1.span)) + _loc8_ < _loc6_)
  384.                {
  385.                   _loc11_ = _loc6_;
  386.                   _loc12_ = _loc10_ - (_loc6_ - _loc8_) + _loc9_;
  387.                }
  388.                else
  389.                {
  390.                   _loc11_ = _loc13_ + _loc8_;
  391.                }
  392.                if(_loc13_ + _loc9_ < _loc7_)
  393.                {
  394.                   _loc12_ = _loc7_;
  395.                   _loc11_ = _loc10_ - (_loc7_ - _loc9_) + _loc8_;
  396.                }
  397.                else
  398.                {
  399.                   _loc12_ = _loc13_ + _loc9_;
  400.                }
  401.             }
  402.             _loc12_ = bound(_loc12_,_loc4_.minHeight,_loc4_.maxHeight);
  403.             _loc4_.setActualHeight(_loc12_);
  404.             param2 -= _loc12_;
  405.             _loc11_ = bound(_loc11_,_loc3_.minHeight,_loc3_.maxHeight);
  406.             _loc3_.setActualHeight(_loc11_);
  407.             param2 -= _loc11_;
  408.          }
  409.          return param2;
  410.       }
  411.       
  412.       private function parseConstraintExp(param1:String) : Array
  413.       {
  414.          if(!param1)
  415.          {
  416.             return null;
  417.          }
  418.          var _loc2_:String = param1.replace(/:/g," ");
  419.          return _loc2_.split(/\s+/);
  420.       }
  421.       
  422.       private function measureColumnsAndRows() : void
  423.       {
  424.          var _loc3_:int = 0;
  425.          var _loc4_:int = 0;
  426.          var _loc13_:ConstraintColumn = null;
  427.          var _loc14_:ConstraintRow = null;
  428.          var _loc15_:Number = NaN;
  429.          var _loc16_:Number = NaN;
  430.          var _loc17_:Number = NaN;
  431.          var _loc18_:Number = NaN;
  432.          var _loc19_:ContentColumnChild = null;
  433.          var _loc20_:ContentRowChild = null;
  434.          var _loc1_:Array = IConstraintLayout(target).constraintColumns;
  435.          var _loc2_:Array = IConstraintLayout(target).constraintRows;
  436.          if(!_loc2_.length > 0 && !_loc1_.length > 0)
  437.          {
  438.             constraintRegionsInUse = false;
  439.             return;
  440.          }
  441.          constraintRegionsInUse = true;
  442.          var _loc5_:Number = 0;
  443.          var _loc6_:Number = 0;
  444.          var _loc7_:EdgeMetrics = Container(target).viewMetrics;
  445.          var _loc8_:Number = Container(target).width - _loc7_.left - _loc7_.right;
  446.          var _loc9_:Number = Container(target).height - _loc7_.top - _loc7_.bottom;
  447.          var _loc10_:Array = [];
  448.          var _loc11_:Array = [];
  449.          var _loc12_:Array = [];
  450.          if(_loc1_.length > 0)
  451.          {
  452.             _loc3_ = 0;
  453.             while(_loc3_ < _loc1_.length)
  454.             {
  455.                _loc13_ = _loc1_[_loc3_];
  456.                if(!isNaN(_loc13_.percentWidth))
  457.                {
  458.                   _loc11_.push(_loc13_);
  459.                }
  460.                else if(!isNaN(_loc13_.width) && !_loc13_.mx_internal::contentSize)
  461.                {
  462.                   _loc10_.push(_loc13_);
  463.                }
  464.                else
  465.                {
  466.                   _loc12_.push(_loc13_);
  467.                   _loc13_.mx_internal::contentSize = true;
  468.                }
  469.                _loc3_++;
  470.             }
  471.             _loc3_ = 0;
  472.             while(_loc3_ < _loc10_.length)
  473.             {
  474.                _loc13_ = ConstraintColumn(_loc10_[_loc3_]);
  475.                _loc8_ -= _loc13_.width;
  476.                _loc3_++;
  477.             }
  478.             if(_loc12_.length > 0)
  479.             {
  480.                if(colSpanChildren.length > 0)
  481.                {
  482.                   colSpanChildren.sortOn("span");
  483.                   _loc4_ = 0;
  484.                   while(_loc4_ < colSpanChildren.length)
  485.                   {
  486.                      if((_loc19_ = colSpanChildren[_loc4_]).span == 1)
  487.                      {
  488.                         if(_loc19_.hcCol)
  489.                         {
  490.                            _loc13_ = ConstraintColumn(_loc1_[_loc1_.indexOf(_loc19_.hcCol)]);
  491.                         }
  492.                         else if(_loc19_.leftCol)
  493.                         {
  494.                            _loc13_ = ConstraintColumn(_loc1_[_loc1_.indexOf(_loc19_.leftCol)]);
  495.                         }
  496.                         else if(_loc19_.rightCol)
  497.                         {
  498.                            _loc13_ = ConstraintColumn(_loc1_[_loc1_.indexOf(_loc19_.rightCol)]);
  499.                         }
  500.                         _loc16_ = _loc19_.child.getExplicitOrMeasuredWidth();
  501.                         if(_loc19_.hcOffset)
  502.                         {
  503.                            _loc16_ += _loc19_.hcOffset;
  504.                         }
  505.                         else
  506.                         {
  507.                            if(_loc19_.leftOffset)
  508.                            {
  509.                               _loc16_ += _loc19_.leftOffset;
  510.                            }
  511.                            if(_loc19_.rightOffset)
  512.                            {
  513.                               _loc16_ += _loc19_.rightOffset;
  514.                            }
  515.                         }
  516.                         if(!isNaN(_loc13_.width))
  517.                         {
  518.                            _loc16_ = Math.max(_loc13_.width,_loc16_);
  519.                         }
  520.                         _loc16_ = bound(_loc16_,_loc13_.minWidth,_loc13_.maxWidth);
  521.                         _loc13_.setActualWidth(_loc16_);
  522.                         _loc8_ -= _loc13_.width;
  523.                      }
  524.                      else
  525.                      {
  526.                         _loc8_ = shareColumnSpace(_loc19_,_loc8_);
  527.                      }
  528.                      _loc4_++;
  529.                   }
  530.                   colSpanChildren = [];
  531.                }
  532.                _loc3_ = 0;
  533.                while(_loc3_ < _loc12_.length)
  534.                {
  535.                   if(!(_loc13_ = _loc12_[_loc3_]).width)
  536.                   {
  537.                      _loc16_ = bound(0,_loc13_.minWidth,0);
  538.                      _loc13_.setActualWidth(_loc16_);
  539.                   }
  540.                   _loc3_++;
  541.                }
  542.             }
  543.             _loc18_ = _loc8_;
  544.             _loc3_ = 0;
  545.             while(_loc3_ < _loc11_.length)
  546.             {
  547.                _loc13_ = ConstraintColumn(_loc11_[_loc3_]);
  548.                if(_loc18_ <= 0)
  549.                {
  550.                   _loc16_ = 0;
  551.                }
  552.                else
  553.                {
  554.                   _loc16_ = Math.round(_loc18_ * _loc13_.percentWidth / 100);
  555.                }
  556.                _loc16_ = bound(_loc16_,_loc13_.minWidth,_loc13_.maxWidth);
  557.                _loc13_.setActualWidth(_loc16_);
  558.                _loc8_ -= _loc16_;
  559.                _loc3_++;
  560.             }
  561.             _loc3_ = 0;
  562.             while(_loc3_ < _loc1_.length)
  563.             {
  564.                (_loc13_ = ConstraintColumn(_loc1_[_loc3_])).x = _loc5_;
  565.                _loc5_ += _loc13_.width;
  566.                _loc3_++;
  567.             }
  568.          }
  569.          _loc10_ = [];
  570.          _loc11_ = [];
  571.          _loc12_ = [];
  572.          if(_loc2_.length > 0)
  573.          {
  574.             _loc3_ = 0;
  575.             while(_loc3_ < _loc2_.length)
  576.             {
  577.                _loc14_ = _loc2_[_loc3_];
  578.                if(!isNaN(_loc14_.percentHeight))
  579.                {
  580.                   _loc11_.push(_loc14_);
  581.                }
  582.                else if(!isNaN(_loc14_.height) && !_loc14_.mx_internal::contentSize)
  583.                {
  584.                   _loc10_.push(_loc14_);
  585.                }
  586.                else
  587.                {
  588.                   _loc12_.push(_loc14_);
  589.                   _loc14_.mx_internal::contentSize = true;
  590.                }
  591.                _loc3_++;
  592.             }
  593.             _loc3_ = 0;
  594.             while(_loc3_ < _loc10_.length)
  595.             {
  596.                _loc14_ = ConstraintRow(_loc10_[_loc3_]);
  597.                _loc9_ -= _loc14_.height;
  598.                _loc3_++;
  599.             }
  600.             if(_loc12_.length > 0)
  601.             {
  602.                if(rowSpanChildren.length > 0)
  603.                {
  604.                   rowSpanChildren.sortOn("span");
  605.                   _loc4_ = 0;
  606.                   while(_loc4_ < rowSpanChildren.length)
  607.                   {
  608.                      if((_loc20_ = rowSpanChildren[_loc4_]).span == 1)
  609.                      {
  610.                         if(_loc20_.vcRow)
  611.                         {
  612.                            _loc14_ = ConstraintRow(_loc2_[_loc2_.indexOf(_loc20_.vcRow)]);
  613.                         }
  614.                         else if(_loc20_.baselineRow)
  615.                         {
  616.                            _loc14_ = ConstraintRow(_loc2_[_loc2_.indexOf(_loc20_.baselineRow)]);
  617.                         }
  618.                         else if(_loc20_.topRow)
  619.                         {
  620.                            _loc14_ = ConstraintRow(_loc2_[_loc2_.indexOf(_loc20_.topRow)]);
  621.                         }
  622.                         else if(_loc20_.bottomRow)
  623.                         {
  624.                            _loc14_ = ConstraintRow(_loc2_[_loc2_.indexOf(_loc20_.bottomRow)]);
  625.                         }
  626.                         _loc17_ = _loc20_.child.getExplicitOrMeasuredHeight();
  627.                         if(_loc20_.baselineOffset)
  628.                         {
  629.                            _loc17_ += _loc20_.baselineOffset;
  630.                         }
  631.                         else if(_loc20_.vcOffset)
  632.                         {
  633.                            _loc17_ += _loc20_.vcOffset;
  634.                         }
  635.                         else
  636.                         {
  637.                            if(_loc20_.topOffset)
  638.                            {
  639.                               _loc17_ += _loc20_.topOffset;
  640.                            }
  641.                            if(_loc20_.bottomOffset)
  642.                            {
  643.                               _loc17_ += _loc20_.bottomOffset;
  644.                            }
  645.                         }
  646.                         if(!isNaN(_loc14_.height))
  647.                         {
  648.                            _loc17_ = Math.max(_loc14_.height,_loc17_);
  649.                         }
  650.                         _loc17_ = bound(_loc17_,_loc14_.minHeight,_loc14_.maxHeight);
  651.                         _loc14_.setActualHeight(_loc17_);
  652.                         _loc9_ -= _loc14_.height;
  653.                      }
  654.                      else
  655.                      {
  656.                         _loc9_ = shareRowSpace(_loc20_,_loc9_);
  657.                      }
  658.                      _loc4_++;
  659.                   }
  660.                   rowSpanChildren = [];
  661.                }
  662.                _loc3_ = 0;
  663.                while(_loc3_ < _loc12_.length)
  664.                {
  665.                   if(!(_loc14_ = ConstraintRow(_loc12_[_loc3_])).height)
  666.                   {
  667.                      _loc17_ = bound(0,_loc14_.minHeight,0);
  668.                      _loc14_.setActualHeight(_loc17_);
  669.                   }
  670.                   _loc3_++;
  671.                }
  672.             }
  673.             _loc18_ = _loc9_;
  674.             _loc3_ = 0;
  675.             while(_loc3_ < _loc11_.length)
  676.             {
  677.                _loc14_ = ConstraintRow(_loc11_[_loc3_]);
  678.                if(_loc18_ <= 0)
  679.                {
  680.                   _loc17_ = 0;
  681.                }
  682.                else
  683.                {
  684.                   _loc17_ = Math.round(_loc18_ * _loc14_.percentHeight / 100);
  685.                }
  686.                _loc17_ = bound(_loc17_,_loc14_.minHeight,_loc14_.maxHeight);
  687.                _loc14_.setActualHeight(_loc17_);
  688.                _loc9_ -= _loc17_;
  689.                _loc3_++;
  690.             }
  691.             _loc3_ = 0;
  692.             while(_loc3_ < _loc2_.length)
  693.             {
  694.                (_loc14_ = _loc2_[_loc3_]).y = _loc6_;
  695.                _loc6_ += _loc14_.height;
  696.                _loc3_++;
  697.             }
  698.          }
  699.       }
  700.       
  701.       private function child_moveHandler(param1:MoveEvent) : void
  702.       {
  703.          if(param1.target is IUIComponent)
  704.          {
  705.             if(!IUIComponent(param1.target).includeInLayout)
  706.             {
  707.                return;
  708.             }
  709.          }
  710.          var _loc2_:Container = super.target;
  711.          if(_loc2_)
  712.          {
  713.             _loc2_.invalidateSize();
  714.             _loc2_.invalidateDisplayList();
  715.             _contentArea = null;
  716.          }
  717.       }
  718.       
  719.       private function applyAnchorStylesDuringMeasure(param1:IUIComponent, param2:Rectangle) : void
  720.       {
  721.          var _loc13_:int = 0;
  722.          var _loc3_:IConstraintClient = param1 as IConstraintClient;
  723.          if(!_loc3_)
  724.          {
  725.             return;
  726.          }
  727.          var _loc4_:ChildConstraintInfo;
  728.          if(!(_loc4_ = constraintCache[_loc3_]))
  729.          {
  730.             _loc4_ = parseConstraints(param1);
  731.          }
  732.          var _loc5_:Number = _loc4_.left;
  733.          var _loc6_:Number = _loc4_.right;
  734.          var _loc7_:Number = _loc4_.hc;
  735.          var _loc8_:Number = _loc4_.top;
  736.          var _loc9_:Number = _loc4_.bottom;
  737.          var _loc10_:Number = _loc4_.vc;
  738.          var _loc11_:Array = IConstraintLayout(target).constraintColumns;
  739.          var _loc12_:Array = IConstraintLayout(target).constraintRows;
  740.          var _loc14_:Number = 0;
  741.          if(!_loc11_.length > 0)
  742.          {
  743.             if(!isNaN(_loc7_))
  744.             {
  745.                param2.x = Math.round((target.width - param1.width) / 2 + _loc7_);
  746.             }
  747.             else if(!isNaN(_loc5_) && !isNaN(_loc6_))
  748.             {
  749.                param2.x = _loc5_;
  750.                param2.width += _loc6_;
  751.             }
  752.             else if(!isNaN(_loc5_))
  753.             {
  754.                param2.x = _loc5_;
  755.             }
  756.             else if(!isNaN(_loc6_))
  757.             {
  758.                param2.x = 0;
  759.                param2.width += _loc6_;
  760.             }
  761.          }
  762.          else
  763.          {
  764.             param2.x = 0;
  765.             _loc13_ = 0;
  766.             while(_loc13_ < _loc11_.length)
  767.             {
  768.                _loc14_ += ConstraintColumn(_loc11_[_loc13_]).width;
  769.                _loc13_++;
  770.             }
  771.             param2.width = _loc14_;
  772.          }
  773.          if(!_loc12_.length > 0)
  774.          {
  775.             if(!isNaN(_loc10_))
  776.             {
  777.                param2.y = Math.round((target.height - param1.height) / 2 + _loc10_);
  778.             }
  779.             else if(!isNaN(_loc8_) && !isNaN(_loc9_))
  780.             {
  781.                param2.y = _loc8_;
  782.                param2.height += _loc9_;
  783.             }
  784.             else if(!isNaN(_loc8_))
  785.             {
  786.                param2.y = _loc8_;
  787.             }
  788.             else if(!isNaN(_loc9_))
  789.             {
  790.                param2.y = 0;
  791.                param2.height += _loc9_;
  792.             }
  793.          }
  794.          else
  795.          {
  796.             _loc14_ = 0;
  797.             param2.y = 0;
  798.             _loc13_ = 0;
  799.             while(_loc13_ < _loc12_.length)
  800.             {
  801.                _loc14_ += ConstraintRow(_loc12_[_loc13_]).height;
  802.                _loc13_++;
  803.             }
  804.             param2.height = _loc14_;
  805.          }
  806.       }
  807.       
  808.       override public function measure() : void
  809.       {
  810.          var _loc1_:Container = null;
  811.          var _loc5_:EdgeMetrics = null;
  812.          var _loc6_:Rectangle = null;
  813.          var _loc7_:IUIComponent = null;
  814.          var _loc8_:ConstraintColumn = null;
  815.          var _loc9_:ConstraintRow = null;
  816.          _loc1_ = super.target;
  817.          var _loc2_:Number = 0;
  818.          var _loc3_:Number = 0;
  819.          var _loc4_:Number = 0;
  820.          _loc5_ = _loc1_.viewMetrics;
  821.          _loc4_ = 0;
  822.          while(_loc4_ < _loc1_.numChildren)
  823.          {
  824.             _loc7_ = _loc1_.getChildAt(_loc4_) as IUIComponent;
  825.             parseConstraints(_loc7_);
  826.             _loc4_++;
  827.          }
  828.          _loc4_ = 0;
  829.          while(_loc4_ < IConstraintLayout(_loc1_).constraintColumns.length)
  830.          {
  831.             if((_loc8_ = IConstraintLayout(_loc1_).constraintColumns[_loc4_]).mx_internal::contentSize)
  832.             {
  833.                _loc8_.mx_internal::_width = NaN;
  834.             }
  835.             _loc4_++;
  836.          }
  837.          _loc4_ = 0;
  838.          while(_loc4_ < IConstraintLayout(_loc1_).constraintRows.length)
  839.          {
  840.             if((_loc9_ = IConstraintLayout(_loc1_).constraintRows[_loc4_]).mx_internal::contentSize)
  841.             {
  842.                _loc9_.mx_internal::_height = NaN;
  843.             }
  844.             _loc4_++;
  845.          }
  846.          measureColumnsAndRows();
  847.          _contentArea = null;
  848.          _loc6_ = measureContentArea();
  849.          _loc1_.measuredWidth = _loc6_.width + _loc5_.left + _loc5_.right;
  850.          _loc1_.measuredHeight = _loc6_.height + _loc5_.top + _loc5_.bottom;
  851.       }
  852.       
  853.       private function target_childRemoveHandler(param1:ChildExistenceChangedEvent) : void
  854.       {
  855.          DisplayObject(param1.relatedObject).removeEventListener(MoveEvent.MOVE,child_moveHandler);
  856.          delete constraintCache[param1.relatedObject];
  857.       }
  858.       
  859.       override public function set target(param1:Container) : void
  860.       {
  861.          var _loc3_:int = 0;
  862.          var _loc4_:int = 0;
  863.          var _loc2_:Container = super.target;
  864.          if(param1 != _loc2_)
  865.          {
  866.             if(_loc2_)
  867.             {
  868.                _loc2_.removeEventListener(ChildExistenceChangedEvent.CHILD_ADD,target_childAddHandler);
  869.                _loc2_.removeEventListener(ChildExistenceChangedEvent.CHILD_REMOVE,target_childRemoveHandler);
  870.                _loc4_ = _loc2_.numChildren;
  871.                _loc3_ = 0;
  872.                while(_loc3_ < _loc4_)
  873.                {
  874.                   DisplayObject(_loc2_.getChildAt(_loc3_)).removeEventListener(MoveEvent.MOVE,child_moveHandler);
  875.                   _loc3_++;
  876.                }
  877.             }
  878.             if(param1)
  879.             {
  880.                param1.addEventListener(ChildExistenceChangedEvent.CHILD_ADD,target_childAddHandler);
  881.                param1.addEventListener(ChildExistenceChangedEvent.CHILD_REMOVE,target_childRemoveHandler);
  882.                _loc4_ = param1.numChildren;
  883.                _loc3_ = 0;
  884.                while(_loc3_ < _loc4_)
  885.                {
  886.                   DisplayObject(param1.getChildAt(_loc3_)).addEventListener(MoveEvent.MOVE,child_moveHandler);
  887.                   _loc3_++;
  888.                }
  889.             }
  890.             super.target = param1;
  891.          }
  892.       }
  893.       
  894.       private function measureContentArea() : Rectangle
  895.       {
  896.          var _loc1_:int = 0;
  897.          var _loc3_:Array = null;
  898.          var _loc4_:Array = null;
  899.          var _loc5_:IUIComponent = null;
  900.          var _loc6_:LayoutConstraints = null;
  901.          var _loc7_:Number = NaN;
  902.          var _loc8_:Number = NaN;
  903.          var _loc9_:Number = NaN;
  904.          var _loc10_:Number = NaN;
  905.          var _loc11_:Number = NaN;
  906.          var _loc12_:Number = NaN;
  907.          if(_contentArea)
  908.          {
  909.             return _contentArea;
  910.          }
  911.          _contentArea = new Rectangle();
  912.          var _loc2_:int = target.numChildren;
  913.          if(_loc2_ == 0 && constraintRegionsInUse)
  914.          {
  915.             _loc3_ = IConstraintLayout(target).constraintColumns;
  916.             _loc4_ = IConstraintLayout(target).constraintRows;
  917.             if(_loc3_.length > 0)
  918.             {
  919.                _contentArea.right = _loc3_[_loc3_.length - 1].x + _loc3_[_loc3_.length - 1].width;
  920.             }
  921.             else
  922.             {
  923.                _contentArea.right = 0;
  924.             }
  925.             if(_loc4_.length > 0)
  926.             {
  927.                _contentArea.bottom = _loc4_[_loc4_.length - 1].y + _loc4_[_loc4_.length - 1].height;
  928.             }
  929.             else
  930.             {
  931.                _contentArea.bottom = 0;
  932.             }
  933.          }
  934.          _loc1_ = 0;
  935.          while(_loc1_ < _loc2_)
  936.          {
  937.             _loc5_ = target.getChildAt(_loc1_) as IUIComponent;
  938.             _loc6_ = getLayoutConstraints(_loc5_);
  939.             if(_loc5_.includeInLayout)
  940.             {
  941.                _loc7_ = _loc5_.x;
  942.                _loc8_ = _loc5_.y;
  943.                _loc9_ = _loc5_.getExplicitOrMeasuredWidth();
  944.                _loc10_ = _loc5_.getExplicitOrMeasuredHeight();
  945.                if(FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
  946.                {
  947.                   if(!isNaN(_loc5_.percentWidth) || _loc6_ && !isNaN(_loc6_.left) && !isNaN(_loc6_.right))
  948.                   {
  949.                      _loc9_ = _loc5_.minWidth;
  950.                   }
  951.                }
  952.                else if(!isNaN(_loc5_.percentWidth) || _loc6_ && !isNaN(_loc6_.left) && !isNaN(_loc6_.right) && isNaN(_loc5_.explicitWidth))
  953.                {
  954.                   _loc9_ = _loc5_.minWidth;
  955.                }
  956.                if(FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
  957.                {
  958.                   if(!isNaN(_loc5_.percentHeight) || _loc6_ && !isNaN(_loc6_.top) && !isNaN(_loc6_.bottom))
  959.                   {
  960.                      _loc10_ = _loc5_.minHeight;
  961.                   }
  962.                }
  963.                else if(!isNaN(_loc5_.percentHeight) || _loc6_ && !isNaN(_loc6_.top) && !isNaN(_loc6_.bottom) && isNaN(_loc5_.explicitHeight))
  964.                {
  965.                   _loc10_ = _loc5_.minHeight;
  966.                }
  967.                r.x = _loc7_;
  968.                r.y = _loc8_;
  969.                r.width = _loc9_;
  970.                r.height = _loc10_;
  971.                applyAnchorStylesDuringMeasure(_loc5_,r);
  972.                _loc7_ = r.x;
  973.                _loc8_ = r.y;
  974.                _loc9_ = r.width;
  975.                _loc10_ = r.height;
  976.                if(isNaN(_loc7_))
  977.                {
  978.                   _loc7_ = _loc5_.x;
  979.                }
  980.                if(isNaN(_loc8_))
  981.                {
  982.                   _loc8_ = _loc5_.y;
  983.                }
  984.                _loc11_ = _loc7_;
  985.                _loc12_ = _loc8_;
  986.                if(isNaN(_loc9_))
  987.                {
  988.                   _loc9_ = _loc5_.width;
  989.                }
  990.                if(isNaN(_loc10_))
  991.                {
  992.                   _loc10_ = _loc5_.height;
  993.                }
  994.                _loc11_ += _loc9_;
  995.                _loc12_ += _loc10_;
  996.                _contentArea.right = Math.max(_contentArea.right,_loc11_);
  997.                _contentArea.bottom = Math.max(_contentArea.bottom,_loc12_);
  998.             }
  999.             _loc1_++;
  1000.          }
  1001.          return _contentArea;
  1002.       }
  1003.       
  1004.       private function shareColumnSpace(param1:ContentColumnChild, param2:Number) : Number
  1005.       {
  1006.          var _loc11_:Number = NaN;
  1007.          var _loc12_:Number = NaN;
  1008.          var _loc13_:Number = NaN;
  1009.          var _loc3_:ConstraintColumn = param1.leftCol;
  1010.          var _loc4_:ConstraintColumn = param1.rightCol;
  1011.          var _loc5_:IUIComponent = param1.child;
  1012.          var _loc6_:Number = 0;
  1013.          var _loc7_:Number = 0;
  1014.          var _loc8_:Number = !!param1.rightOffset ? Number(param1.rightOffset) : Number(0);
  1015.          var _loc9_:Number = !!param1.leftOffset ? Number(param1.leftOffset) : Number(0);
  1016.          if(_loc3_ && _loc3_.width)
  1017.          {
  1018.             _loc6_ += _loc3_.width;
  1019.          }
  1020.          else if(_loc4_ && !_loc3_)
  1021.          {
  1022.             _loc3_ = IConstraintLayout(target).constraintColumns[param1.right - 2];
  1023.             if(_loc3_ && _loc3_.width)
  1024.             {
  1025.                _loc6_ += _loc3_.width;
  1026.             }
  1027.          }
  1028.          if(_loc4_ && _loc4_.width)
  1029.          {
  1030.             _loc7_ += _loc4_.width;
  1031.          }
  1032.          else if(_loc3_ && !_loc4_)
  1033.          {
  1034.             if((_loc4_ = IConstraintLayout(target).constraintColumns[param1.left + 1]) && _loc4_.width)
  1035.             {
  1036.                _loc7_ += _loc4_.width;
  1037.             }
  1038.          }
  1039.          if(_loc3_ && isNaN(_loc3_.width))
  1040.          {
  1041.             _loc3_.setActualWidth(Math.max(0,_loc3_.maxWidth));
  1042.          }
  1043.          if(_loc4_ && isNaN(_loc4_.width))
  1044.          {
  1045.             _loc4_.setActualWidth(Math.max(0,_loc4_.maxWidth));
  1046.          }
  1047.          var _loc10_:Number;
  1048.          if(_loc10_ = _loc5_.getExplicitOrMeasuredWidth())
  1049.          {
  1050.             if(!param1.leftCol)
  1051.             {
  1052.                if(_loc10_ > _loc6_)
  1053.                {
  1054.                   _loc12_ = _loc10_ - _loc6_ + _loc8_;
  1055.                }
  1056.                else
  1057.                {
  1058.                   _loc12_ = _loc10_ + _loc8_;
  1059.                }
  1060.             }
  1061.             if(!param1.rightCol)
  1062.             {
  1063.                if(_loc10_ > _loc7_)
  1064.                {
  1065.                   _loc11_ = _loc10_ - _loc7_ + _loc9_;
  1066.                }
  1067.                else
  1068.                {
  1069.                   _loc11_ = _loc10_ + _loc9_;
  1070.                }
  1071.             }
  1072.             if(param1.leftCol && param1.rightCol)
  1073.             {
  1074.                if((_loc13_ = _loc10_ / Number(param1.span)) + _loc9_ < _loc6_)
  1075.                {
  1076.                   _loc11_ = _loc6_;
  1077.                   _loc12_ = _loc10_ - (_loc6_ - _loc9_) + _loc8_;
  1078.                }
  1079.                else
  1080.                {
  1081.                   _loc11_ = _loc13_ + _loc9_;
  1082.                }
  1083.                if(_loc13_ + _loc8_ < _loc7_)
  1084.                {
  1085.                   _loc12_ = _loc7_;
  1086.                   _loc11_ = _loc10_ - (_loc7_ - _loc8_) + _loc9_;
  1087.                }
  1088.                else
  1089.                {
  1090.                   _loc12_ = _loc13_ + _loc8_;
  1091.                }
  1092.             }
  1093.             _loc11_ = bound(_loc11_,_loc3_.minWidth,_loc3_.maxWidth);
  1094.             _loc3_.setActualWidth(_loc11_);
  1095.             param2 -= _loc11_;
  1096.             _loc12_ = bound(_loc12_,_loc4_.minWidth,_loc4_.maxWidth);
  1097.             _loc4_.setActualWidth(_loc12_);
  1098.             param2 -= _loc12_;
  1099.          }
  1100.          return param2;
  1101.       }
  1102.       
  1103.       private function getLayoutConstraints(param1:IUIComponent) : LayoutConstraints
  1104.       {
  1105.          var _loc2_:IConstraintClient = param1 as IConstraintClient;
  1106.          if(!_loc2_)
  1107.          {
  1108.             return null;
  1109.          }
  1110.          var _loc3_:LayoutConstraints = new LayoutConstraints();
  1111.          _loc3_.baseline = _loc2_.getConstraintValue("baseline");
  1112.          _loc3_.bottom = _loc2_.getConstraintValue("bottom");
  1113.          _loc3_.horizontalCenter = _loc2_.getConstraintValue("horizontalCenter");
  1114.          _loc3_.left = _loc2_.getConstraintValue("left");
  1115.          _loc3_.right = _loc2_.getConstraintValue("right");
  1116.          _loc3_.top = _loc2_.getConstraintValue("top");
  1117.          _loc3_.verticalCenter = _loc2_.getConstraintValue("verticalCenter");
  1118.          return _loc3_;
  1119.       }
  1120.       
  1121.       override public function updateDisplayList(param1:Number, param2:Number) : void
  1122.       {
  1123.          var _loc3_:int = 0;
  1124.          var _loc4_:IUIComponent = null;
  1125.          var _loc10_:ConstraintColumn = null;
  1126.          var _loc11_:ConstraintRow = null;
  1127.          var _loc5_:Container;
  1128.          var _loc6_:int = (_loc5_ = super.target).numChildren;
  1129.          _loc5_.mx_internal::doingLayout = false;
  1130.          var _loc7_:EdgeMetrics = _loc5_.viewMetrics;
  1131.          _loc5_.mx_internal::doingLayout = true;
  1132.          var _loc8_:Number = param1 - _loc7_.left - _loc7_.right;
  1133.          var _loc9_:Number = param2 - _loc7_.top - _loc7_.bottom;
  1134.          if(IConstraintLayout(_loc5_).constraintColumns.length > 0 || IConstraintLayout(_loc5_).constraintRows.length > 0)
  1135.          {
  1136.             constraintRegionsInUse = true;
  1137.          }
  1138.          if(constraintRegionsInUse)
  1139.          {
  1140.             _loc3_ = 0;
  1141.             while(_loc3_ < _loc6_)
  1142.             {
  1143.                _loc4_ = _loc5_.getChildAt(_loc3_) as IUIComponent;
  1144.                parseConstraints(_loc4_);
  1145.                _loc3_++;
  1146.             }
  1147.             _loc3_ = 0;
  1148.             while(_loc3_ < IConstraintLayout(_loc5_).constraintColumns.length)
  1149.             {
  1150.                if((_loc10_ = IConstraintLayout(_loc5_).constraintColumns[_loc3_]).mx_internal::contentSize)
  1151.                {
  1152.                   _loc10_.mx_internal::_width = NaN;
  1153.                }
  1154.                _loc3_++;
  1155.             }
  1156.             _loc3_ = 0;
  1157.             while(_loc3_ < IConstraintLayout(_loc5_).constraintRows.length)
  1158.             {
  1159.                if((_loc11_ = IConstraintLayout(_loc5_).constraintRows[_loc3_]).mx_internal::contentSize)
  1160.                {
  1161.                   _loc11_.mx_internal::_height = NaN;
  1162.                }
  1163.                _loc3_++;
  1164.             }
  1165.             measureColumnsAndRows();
  1166.          }
  1167.          _loc3_ = 0;
  1168.          while(_loc3_ < _loc6_)
  1169.          {
  1170.             _loc4_ = _loc5_.getChildAt(_loc3_) as IUIComponent;
  1171.             applyAnchorStylesDuringUpdateDisplayList(_loc8_,_loc9_,_loc4_);
  1172.             _loc3_++;
  1173.          }
  1174.       }
  1175.       
  1176.       private function applyAnchorStylesDuringUpdateDisplayList(param1:Number, param2:Number, param3:IUIComponent = null) : void
  1177.       {
  1178.          var _loc20_:int = 0;
  1179.          var _loc21_:Number = NaN;
  1180.          var _loc22_:Number = NaN;
  1181.          var _loc23_:Number = NaN;
  1182.          var _loc24_:Number = NaN;
  1183.          var _loc25_:String = null;
  1184.          var _loc34_:Number = NaN;
  1185.          var _loc35_:Number = NaN;
  1186.          var _loc36_:Number = NaN;
  1187.          var _loc37_:Number = NaN;
  1188.          var _loc38_:Number = NaN;
  1189.          var _loc39_:Boolean = false;
  1190.          var _loc40_:Boolean = false;
  1191.          var _loc41_:Boolean = false;
  1192.          var _loc42_:ConstraintColumn = null;
  1193.          var _loc43_:Boolean = false;
  1194.          var _loc44_:Boolean = false;
  1195.          var _loc45_:Boolean = false;
  1196.          var _loc46_:Boolean = false;
  1197.          var _loc47_:ConstraintRow = null;
  1198.          var _loc4_:IConstraintClient;
  1199.          if(!(_loc4_ = param3 as IConstraintClient))
  1200.          {
  1201.             return;
  1202.          }
  1203.          var _loc5_:ChildConstraintInfo;
  1204.          var _loc6_:Number = (_loc5_ = parseConstraints(param3)).left;
  1205.          var _loc7_:Number = _loc5_.right;
  1206.          var _loc8_:Number = _loc5_.hc;
  1207.          var _loc9_:Number = _loc5_.top;
  1208.          var _loc10_:Number = _loc5_.bottom;
  1209.          var _loc11_:Number = _loc5_.vc;
  1210.          var _loc12_:Number = _loc5_.baseline;
  1211.          var _loc13_:String = _loc5_.leftBoundary;
  1212.          var _loc14_:String = _loc5_.rightBoundary;
  1213.          var _loc15_:String = _loc5_.hcBoundary;
  1214.          var _loc16_:String = _loc5_.topBoundary;
  1215.          var _loc17_:String = _loc5_.bottomBoundary;
  1216.          var _loc18_:String = _loc5_.vcBoundary;
  1217.          var _loc19_:String = _loc5_.baselineBoundary;
  1218.          var _loc26_:Boolean = false;
  1219.          var _loc27_:Boolean = false;
  1220.          var _loc28_:Boolean = !_loc15_ && !_loc13_ && !_loc14_;
  1221.          var _loc29_:Boolean = !_loc18_ && !_loc16_ && !_loc17_ && !_loc19_;
  1222.          var _loc30_:Number = 0;
  1223.          var _loc31_:Number = param1;
  1224.          var _loc32_:Number = 0;
  1225.          var _loc33_:Number = param2;
  1226.          if(!_loc28_)
  1227.          {
  1228.             _loc39_ = !!_loc13_ ? true : false;
  1229.             _loc40_ = !!_loc14_ ? true : false;
  1230.             _loc41_ = !!_loc15_ ? true : false;
  1231.             _loc20_ = 0;
  1232.             while(_loc20_ < IConstraintLayout(target).constraintColumns.length)
  1233.             {
  1234.                _loc42_ = ConstraintColumn(IConstraintLayout(target).constraintColumns[_loc20_]);
  1235.                if(_loc39_)
  1236.                {
  1237.                   if(_loc13_ == _loc42_.id)
  1238.                   {
  1239.                      _loc30_ = _loc42_.x;
  1240.                      _loc39_ = false;
  1241.                   }
  1242.                }
  1243.                if(_loc40_)
  1244.                {
  1245.                   if(_loc14_ == _loc42_.id)
  1246.                   {
  1247.                      _loc31_ = _loc42_.x + _loc42_.width;
  1248.                      _loc40_ = false;
  1249.                   }
  1250.                }
  1251.                if(_loc41_)
  1252.                {
  1253.                   if(_loc15_ == _loc42_.id)
  1254.                   {
  1255.                      _loc35_ = _loc42_.width;
  1256.                      _loc37_ = _loc42_.x;
  1257.                      _loc41_ = false;
  1258.                   }
  1259.                }
  1260.                _loc20_++;
  1261.             }
  1262.             if(_loc39_)
  1263.             {
  1264.                _loc25_ = resourceManager.getString("containers","columnNotFound",[_loc13_]);
  1265.                throw new ConstraintError(_loc25_);
  1266.             }
  1267.             if(_loc40_)
  1268.             {
  1269.                _loc25_ = resourceManager.getString("containers","columnNotFound",[_loc14_]);
  1270.                throw new ConstraintError(_loc25_);
  1271.             }
  1272.             if(_loc41_)
  1273.             {
  1274.                _loc25_ = resourceManager.getString("containers","columnNotFound",[_loc15_]);
  1275.                throw new ConstraintError(_loc25_);
  1276.             }
  1277.          }
  1278.          else if(!_loc28_)
  1279.          {
  1280.             _loc25_ = resourceManager.getString("containers","noColumnsFound");
  1281.             throw new ConstraintError(_loc25_);
  1282.          }
  1283.          param1 = Math.round(_loc31_ - _loc30_);
  1284.          if(!isNaN(_loc6_) && !isNaN(_loc7_))
  1285.          {
  1286.             if((_loc21_ = param1 - _loc6_ - _loc7_) < param3.minWidth)
  1287.             {
  1288.                _loc21_ = param3.minWidth;
  1289.             }
  1290.          }
  1291.          else if(!isNaN(param3.percentWidth))
  1292.          {
  1293.             _loc21_ = param3.percentWidth / 100 * param1;
  1294.             _loc21_ = bound(_loc21_,param3.minWidth,param3.maxWidth);
  1295.             _loc26_ = true;
  1296.          }
  1297.          else
  1298.          {
  1299.             _loc21_ = param3.getExplicitOrMeasuredWidth();
  1300.          }
  1301.          if(!_loc29_ && IConstraintLayout(target).constraintRows.length > 0)
  1302.          {
  1303.             _loc43_ = !!_loc16_ ? true : false;
  1304.             _loc44_ = !!_loc17_ ? true : false;
  1305.             _loc45_ = !!_loc18_ ? true : false;
  1306.             _loc46_ = !!_loc19_ ? true : false;
  1307.             _loc20_ = 0;
  1308.             while(_loc20_ < IConstraintLayout(target).constraintRows.length)
  1309.             {
  1310.                _loc47_ = ConstraintRow(IConstraintLayout(target).constraintRows[_loc20_]);
  1311.                if(_loc43_)
  1312.                {
  1313.                   if(_loc16_ == _loc47_.id)
  1314.                   {
  1315.                      _loc32_ = _loc47_.y;
  1316.                      _loc43_ = false;
  1317.                   }
  1318.                }
  1319.                if(_loc44_)
  1320.                {
  1321.                   if(_loc17_ == _loc47_.id)
  1322.                   {
  1323.                      _loc33_ = _loc47_.y + _loc47_.height;
  1324.                      _loc44_ = false;
  1325.                   }
  1326.                }
  1327.                if(_loc45_)
  1328.                {
  1329.                   if(_loc18_ == _loc47_.id)
  1330.                   {
  1331.                      _loc34_ = _loc47_.height;
  1332.                      _loc36_ = _loc47_.y;
  1333.                      _loc45_ = false;
  1334.                   }
  1335.                }
  1336.                if(_loc46_)
  1337.                {
  1338.                   if(_loc19_ == _loc47_.id)
  1339.                   {
  1340.                      _loc38_ = _loc47_.y;
  1341.                      _loc46_ = false;
  1342.                   }
  1343.                }
  1344.                _loc20_++;
  1345.             }
  1346.             if(_loc43_)
  1347.             {
  1348.                _loc25_ = resourceManager.getString("containers","rowNotFound",[_loc16_]);
  1349.                throw new ConstraintError(_loc25_);
  1350.             }
  1351.             if(_loc44_)
  1352.             {
  1353.                _loc25_ = resourceManager.getString("containers","rowNotFound",[_loc17_]);
  1354.                throw new ConstraintError(_loc25_);
  1355.             }
  1356.             if(_loc45_)
  1357.             {
  1358.                _loc25_ = resourceManager.getString("containers","rowNotFound",[_loc18_]);
  1359.                throw new ConstraintError(_loc25_);
  1360.             }
  1361.             if(_loc46_)
  1362.             {
  1363.                _loc25_ = resourceManager.getString("containers","rowNotFound",[_loc19_]);
  1364.                throw new ConstraintError(_loc25_);
  1365.             }
  1366.          }
  1367.          else if(!_loc29_ && IConstraintLayout(target).constraintRows.length <= 0)
  1368.          {
  1369.             _loc25_ = resourceManager.getString("containers","noRowsFound");
  1370.             throw new ConstraintError(_loc25_);
  1371.          }
  1372.          param2 = Math.round(_loc33_ - _loc32_);
  1373.          if(!isNaN(_loc9_) && !isNaN(_loc10_))
  1374.          {
  1375.             if((_loc22_ = param2 - _loc9_ - _loc10_) < param3.minHeight)
  1376.             {
  1377.                _loc22_ = param3.minHeight;
  1378.             }
  1379.          }
  1380.          else if(!isNaN(param3.percentHeight))
  1381.          {
  1382.             _loc22_ = param3.percentHeight / 100 * param2;
  1383.             _loc22_ = bound(_loc22_,param3.minHeight,param3.maxHeight);
  1384.             _loc27_ = true;
  1385.          }
  1386.          else
  1387.          {
  1388.             _loc22_ = param3.getExplicitOrMeasuredHeight();
  1389.          }
  1390.          if(!isNaN(_loc8_))
  1391.          {
  1392.             if(_loc15_)
  1393.             {
  1394.                _loc23_ = Math.round((_loc35_ - _loc21_) / 2 + _loc8_ + _loc37_);
  1395.             }
  1396.             else
  1397.             {
  1398.                _loc23_ = Math.round((param1 - _loc21_) / 2 + _loc8_);
  1399.             }
  1400.          }
  1401.          else if(!isNaN(_loc6_))
  1402.          {
  1403.             if(_loc13_)
  1404.             {
  1405.                _loc23_ = _loc30_ + _loc6_;
  1406.             }
  1407.             else
  1408.             {
  1409.                _loc23_ = _loc6_;
  1410.             }
  1411.          }
  1412.          else if(!isNaN(_loc7_))
  1413.          {
  1414.             if(_loc14_)
  1415.             {
  1416.                _loc23_ = _loc31_ - _loc7_ - _loc21_;
  1417.             }
  1418.             else
  1419.             {
  1420.                _loc23_ = param1 - _loc7_ - _loc21_;
  1421.             }
  1422.          }
  1423.          if(!isNaN(_loc12_))
  1424.          {
  1425.             if(_loc19_)
  1426.             {
  1427.                _loc24_ = _loc38_ - param3.baselinePosition + _loc12_;
  1428.             }
  1429.             else
  1430.             {
  1431.                _loc24_ = _loc12_;
  1432.             }
  1433.          }
  1434.          if(!isNaN(_loc11_))
  1435.          {
  1436.             if(_loc18_)
  1437.             {
  1438.                _loc24_ = Math.round((_loc34_ - _loc22_) / 2 + _loc11_ + _loc36_);
  1439.             }
  1440.             else
  1441.             {
  1442.                _loc24_ = Math.round((param2 - _loc22_) / 2 + _loc11_);
  1443.             }
  1444.          }
  1445.          else if(!isNaN(_loc9_))
  1446.          {
  1447.             if(_loc16_)
  1448.             {
  1449.                _loc24_ = _loc32_ + _loc9_;
  1450.             }
  1451.             else
  1452.             {
  1453.                _loc24_ = _loc9_;
  1454.             }
  1455.          }
  1456.          else if(!isNaN(_loc10_))
  1457.          {
  1458.             if(_loc17_)
  1459.             {
  1460.                _loc24_ = _loc33_ - _loc10_ - _loc22_;
  1461.             }
  1462.             else
  1463.             {
  1464.                _loc24_ = param2 - _loc10_ - _loc22_;
  1465.             }
  1466.          }
  1467.          _loc23_ = !!isNaN(_loc23_) ? Number(param3.x) : Number(_loc23_);
  1468.          _loc24_ = !!isNaN(_loc24_) ? Number(param3.y) : Number(_loc24_);
  1469.          param3.move(_loc23_,_loc24_);
  1470.          if(_loc26_)
  1471.          {
  1472.             if(_loc23_ + _loc21_ > param1)
  1473.             {
  1474.                _loc21_ = Math.max(param1 - _loc23_,param3.minWidth);
  1475.             }
  1476.          }
  1477.          if(_loc27_)
  1478.          {
  1479.             if(_loc24_ + _loc22_ > param2)
  1480.             {
  1481.                _loc22_ = Math.max(param2 - _loc24_,param3.minHeight);
  1482.             }
  1483.          }
  1484.          if(!isNaN(_loc21_) && !isNaN(_loc22_))
  1485.          {
  1486.             param3.setActualSize(_loc21_,_loc22_);
  1487.          }
  1488.       }
  1489.       
  1490.       private function target_childAddHandler(param1:ChildExistenceChangedEvent) : void
  1491.       {
  1492.          DisplayObject(param1.relatedObject).addEventListener(MoveEvent.MOVE,child_moveHandler);
  1493.       }
  1494.    }
  1495. }
  1496.  
  1497. class LayoutConstraints
  1498. {
  1499.     
  1500.    
  1501.    public var baseline;
  1502.    
  1503.    public var left;
  1504.    
  1505.    public var bottom;
  1506.    
  1507.    public var top;
  1508.    
  1509.    public var horizontalCenter;
  1510.    
  1511.    public var verticalCenter;
  1512.    
  1513.    public var right;
  1514.    
  1515.    function LayoutConstraints()
  1516.    {
  1517.       super();
  1518.    }
  1519. }
  1520.  
  1521. class ChildConstraintInfo
  1522. {
  1523.     
  1524.    
  1525.    public var baseline:Number;
  1526.    
  1527.    public var left:Number;
  1528.    
  1529.    public var baselineBoundary:String;
  1530.    
  1531.    public var leftBoundary:String;
  1532.    
  1533.    public var hcBoundary:String;
  1534.    
  1535.    public var top:Number;
  1536.    
  1537.    public var right:Number;
  1538.    
  1539.    public var topBoundary:String;
  1540.    
  1541.    public var rightBoundary:String;
  1542.    
  1543.    public var bottom:Number;
  1544.    
  1545.    public var vc:Number;
  1546.    
  1547.    public var bottomBoundary:String;
  1548.    
  1549.    public var vcBoundary:String;
  1550.    
  1551.    public var hc:Number;
  1552.    
  1553.    function ChildConstraintInfo(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number, param6:Number, param7:Number, param8:String = null, param9:String = null, param10:String = null, param11:String = null, param12:String = null, param13:String = null, param14:String = null)
  1554.    {
  1555.       super();
  1556.       this.left = param1;
  1557.       this.right = param2;
  1558.       this.hc = param3;
  1559.       this.top = param4;
  1560.       this.bottom = param5;
  1561.       this.vc = param6;
  1562.       this.baseline = param7;
  1563.       this.leftBoundary = param8;
  1564.       this.rightBoundary = param9;
  1565.       this.hcBoundary = param10;
  1566.       this.topBoundary = param11;
  1567.       this.bottomBoundary = param12;
  1568.       this.vcBoundary = param13;
  1569.       this.baselineBoundary = param14;
  1570.    }
  1571. }
  1572.  
  1573. import mx.containers.utilityClasses.ConstraintColumn;
  1574. import mx.core.IUIComponent;
  1575.  
  1576. class ContentColumnChild
  1577. {
  1578.     
  1579.    
  1580.    public var rightCol:ConstraintColumn;
  1581.    
  1582.    public var hcCol:ConstraintColumn;
  1583.    
  1584.    public var left:Number;
  1585.    
  1586.    public var child:IUIComponent;
  1587.    
  1588.    public var rightOffset:Number;
  1589.    
  1590.    public var span:Number;
  1591.    
  1592.    public var hcOffset:Number;
  1593.    
  1594.    public var leftCol:ConstraintColumn;
  1595.    
  1596.    public var leftOffset:Number;
  1597.    
  1598.    public var hc:Number;
  1599.    
  1600.    public var right:Number;
  1601.    
  1602.    function ContentColumnChild()
  1603.    {
  1604.       super();
  1605.    }
  1606. }
  1607.  
  1608. import mx.containers.utilityClasses.ConstraintRow;
  1609. import mx.core.IUIComponent;
  1610.  
  1611. class ContentRowChild
  1612. {
  1613.     
  1614.    
  1615.    public var topRow:ConstraintRow;
  1616.    
  1617.    public var topOffset:Number;
  1618.    
  1619.    public var baseline:Number;
  1620.    
  1621.    public var baselineRow:ConstraintRow;
  1622.    
  1623.    public var span:Number;
  1624.    
  1625.    public var top:Number;
  1626.    
  1627.    public var vcOffset:Number;
  1628.    
  1629.    public var child:IUIComponent;
  1630.    
  1631.    public var bottomOffset:Number;
  1632.    
  1633.    public var bottom:Number;
  1634.    
  1635.    public var vc:Number;
  1636.    
  1637.    public var bottomRow:ConstraintRow;
  1638.    
  1639.    public var vcRow:ConstraintRow;
  1640.    
  1641.    public var baselineOffset:Number;
  1642.    
  1643.    function ContentRowChild()
  1644.    {
  1645.       super();
  1646.    }
  1647. }
  1648.